<template>
  <div class="trip">
    <van-nav-bar @click-left="onClickLeft" left-text="返回" left-arrow>
      <template #right>
        <van-icon name="service" size="18" />
      </template>
    </van-nav-bar>
    <Loading :isShow="show" />
  </div>
</template>

<script setup>
import { useRoute } from "vue-router";
import { reqTrip } from "@/api/home";
import { ref } from "vue";
import { showToast } from "vant";
import Loading from "@/components/loading.vue";
const onClickLeft = () => history.back();
const route = useRoute();
let show = ref(true);
const product_id = route.query.product_id;
// 10000:出发地id; 20000:套餐id
const departId = route.query.departId;
const setMealId = route.query.setMealId;
const date = route.query.date;
// showToast("点击图标");
const loadTrip = async () => {
  const result = await reqTrip({
    product_id,
    date,
    combo_key: `10000:${departId};20000:${setMealId}`,
  });
  console.log(result);
  if (result.code == 404) {
    showToast(result.message);
    history.back();
    show.value = false;
  } else if (result.code == 200) {
  }
};
loadTrip();
</script>

<style scoped></style>
